package com.infore.remoteControl.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.remoteControl.constant.InstructionConstants;
import com.infore.remoteControl.dto.InstructionsDto;
import com.infore.remoteControl.enums.ResultStatus;
import com.infore.remoteControl.service.IScheduleService;
import com.infore.remoteControl.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 调度管理控制器
 * @author Cold
 *
 */
@Api(value = "调度管理接口", tags = {"调度管理接口" })
@RestController
@RequestMapping("/schedule")
public class ScheduleController {
	
	@Autowired
	IScheduleService iScheduleService;
	
	@ApiOperation(value = "指令接收接口")
	@ResponseBody
	@RequestMapping(value = "/instructions", method = RequestMethod.POST)
	public ResultEntity instructionReception(@RequestBody List<InstructionsDto> instructionsDtoList) {
		iScheduleService.schedule(instructionsDtoList);
		return new ResultEntity(ResultStatus.SUCCESS, InstructionConstants.RECEIVE_INSTRUCTION_SUCCESS);
	}
}
